package com.accenture.adf.newcodington.module9.sample;

/**
 * 
* Movie3D is about a movie theater in New Codington
* 
* Topic: Demo on usage of getter and setter methods and local variables
* 
* Instructions:
* 1. Use 'Movie3D_Demo3' as the starting point and add the following changes
* 2. Change the class name to 'Movie3D_Demo4'
* 		a. Change all references of 'Movie3D_Demo3' to 'Movie3D_Demo4' (for example constructors)
*       (Hint: use the Search and Replace feature in Eclipse)
* 3. Create get() and set() methods for each of the non static variables with appropriate parameters 
*    and return types after parameterized constructor
* 4. All set() methods assigns the value of the argument to the respective instance variable
* 5. All get() methods will return the current value of the respective instance variable
* 6. Print all the variable values using respective get() methods to console inside main() method using 'Movie3D_Demo4' instance
* 7. Use any of the get() and set() methods to read / write values for the respective instance variables
* 
*/


public class Movie3D_Demo4 {
	
	//Static fields
	private static String theaterType;
	private static String theaterName;
	
	//Instance variables
	private int screenId;
	private int screenSize;
	private double temperature;
	private int noOfSeats;
	private String movieName;

	static{
		theaterType = "3D";
		theaterName = "Cinema One";
		System.out.println("Static block initialiazed.");
	}
	
	public static void main(String[] args){
		System.out.println("Theater Type : " + theaterType);
		System.out.println("Theater Name : " + theaterName);

		//movie3d - is a local variable
		Movie3D_Demo4 movie1  = new Movie3D_Demo4(1, 35, 28, 50, "Avatar 3D");
		
		System.out.println();
		System.out.println("Screen ID: "+ movie1.getScreenId());
		System.out.println("Screen size: "+ movie1.getScreenSize());
		System.out.println("theater temperature: "+ movie1.getTemperature());
		System.out.println("theater seating capacity: "+ movie1.getNoOfSeats());
		System.out.println("Movie name: "+ movie1.getMovieName());

		Movie3D_Demo4 movie2  = new Movie3D_Demo4(2, 50, 25, 100, "Hugo 3D");
		
		System.out.println();
		System.out.println("Screen ID: "+ movie2.getScreenId());
		System.out.println("Screen size: "+ movie2.getScreenSize());
		System.out.println("theater temperature: "+ movie2.getTemperature());
		System.out.println("theater seating capacity: "+ movie2.getNoOfSeats());
		System.out.println("Movie name: "+ movie2.getMovieName());
		
		// Temperature setter and getter
		movie1.setTemperature(25.5);
		System.out.println();
		System.out.println("Theatre temperature setting changed for Screen #" + movie1.getScreenId()
				+ " to: "+ movie1.getTemperature());
		
	}
	
	//Generic Constructor
	public Movie3D_Demo4() {
		System.out.println("Default constructor invoked.");
	}
	
	//Parameterized constructor
	public Movie3D_Demo4(int screenId, int screenSize, double temparature, int noOfSeats,String movieName) {		
		this.screenId = screenId;		
		this.screenSize = screenSize;
		this.temperature = temparature;
		this.noOfSeats = noOfSeats;
		this.movieName = movieName;
		
		System.out.println("\nParameterized constructor invoked.");
	}

	//Setter and Getter methods
	/**
	 * @return the screenId
	 */
	public int getScreenId() {
		return screenId;
	}

	/**
	 * @param screenId the screenId to set
	 */
	public void setScreenId(int screenId) {
		this.screenId = screenId;
	}

	public int getScreenSize() {
		return screenSize;
	}

	public void setScreenSize(int screenSize) {
		this.screenSize = screenSize;
	}

	public double getTemperature() {
		return temperature;
	}

	public void setTemperature(double temperature) {
		this.temperature = temperature;
	}

	public int getNoOfSeats() {
		return noOfSeats;
	}

	public void setNoOfSeats(int noOfSeats) {
		this.noOfSeats = noOfSeats;
	}

	public String getMovieName() {
		return movieName;
	}

	public void setMovieName(String movieName) {
		this.movieName = movieName;
	}	

}
